package com.aspose.cells;

abstract class zawp extends zawf {
   protected zaay a;
   protected zahn[] b;
   protected zagj c;
   protected zagu d;
   protected boolean[] e;
   protected boolean[] f;
   protected int g;
   protected zagu h;
   protected int i;

   public zawp(zahn[] var1, zagj var2, zaay var3) {
      this.b = var1;
      this.c = var2;
      this.a = var3;
      this.e = new boolean[var1.length];
      this.f = new boolean[var1.length];
      this.g = var1.length;
   }

   protected zahn[] e(zaay var1) {
      zahn[] var2 = new zahn[this.b.length];

      for(int var3 = 0; var3 < var2.length; ++var3) {
         var2[var3] = this.b[var3].b(var1);
      }

      return var2;
   }

   public int b() {
      return this.c.b();
   }

   public zagu a(int var1, int var2) {
      boolean var3 = true;

      for(int var5 = 0; var5 < this.b.length; ++var5) {
         zahn var4 = this.b[var5];
         zagu var6 = var4.a(var1, var2);
         if (var3) {
            if (var4.a(var6)) {
               continue;
            }

            var3 = false;
            this.c.c();
            if (var5 > 0) {
               for(int var7 = 0; var7 < var5; ++var7) {
                  if (this.c.a(var7, this.b[var7].o())) {
                     return this.c.e();
                  }
               }
            }
         }

         if (this.c.a(var5, var6)) {
            return this.c.e();
         }
      }

      if (var3) {
         return this.o();
      } else {
         return this.c.d();
      }
   }

   public void f() {
      for(int var1 = 0; var1 < this.b.length; ++var1) {
         this.b[var1].f();
         this.e[var1] = true;
         this.f[var1] = true;
      }

      this.i = -1;
      this.g = this.b.length;
   }

   public zagu h() {
      if (this.h != null) {
         return this.h;
      } else {
         this.c.c();

         for(int var1 = 0; var1 < this.b.length; ++var1) {
            if (this.e[var1]) {
               if (this.c.a(var1, this.b[var1].h())) {
                  this.h = this.c.e();
                  return this.h;
               }
            } else if (this.c.a(var1, this.b[var1].o())) {
               if (this.c.f()) {
                  this.i = var1;
               }

               this.h = this.c.e();
               return this.h;
            }
         }

         this.h = this.c.d();
         return this.h;
      }
   }

   public zagu o() {
      if (this.d == null) {
         this.c.c();

         for(int var1 = 0; var1 < this.b.length; ++var1) {
            if (this.c.a(var1, this.b[var1].o())) {
               this.d = this.c.e();
               this.d.a(false);
               return this.d;
            }
         }

         this.d = this.c.b(false);
         this.d.a(false);
      }

      return this.d;
   }

   public zagu p() {
      if (this.d == null) {
         this.c.c();

         for(int var2 = 0; var2 < this.b.length; ++var2) {
            zagu var1 = this.b[var2].p();
            if (var1 == null) {
               return null;
            }

            if (this.c.a(var2, var1)) {
               this.d = this.c.e();
               this.d.a(false);
               return this.d;
            }
         }

         this.d = this.c.b(true);
         if (this.d != null) {
            this.d.a(false);
         }
      }

      return this.d;
   }

   public boolean a(zagu var1) {
      return var1 == this.d;
   }

   public void a(zaay var1) {
      if (this.a != var1) {
         this.a.g = var1.g;
         this.a.h = var1.h;
      }

      for(int var2 = 0; var2 < this.b.length; ++var2) {
         this.b[var2].a(this.a);
      }

      this.c.b(this.a);
   }

   public boolean x() {
      return this.b[0].x();
   }

   public boolean y() {
      return this.b[0].y();
   }

   public boolean l() {
      return false;
   }

   public boolean a(zaay var1, int[] var2) {
      this.b[0].a(var1, var2);
      int var3 = var2[0];
      int var4 = var2[1];
      int var5 = var2[2];
      int var6 = var2[3];

      for(int var7 = 1; var7 < this.b.length; ++var7) {
         this.b[var7].a(var1, var2);
         if (var3 < var2[0]) {
            var2[0] = var3;
         }

         if (var4 < var2[1]) {
            var2[1] = var4;
         }

         if (var5 > var2[2]) {
            var2[2] = var5;
         }

         if (var6 > var2[3]) {
            var2[3] = var6;
         }
      }

      return true;
   }

   public boolean b(zaay var1, int[] var2) {
      this.b[0].b(var1, var2);
      int var3 = var2[0];
      int var4 = var2[1];

      for(int var5 = 1; var5 < this.b.length; ++var5) {
         this.b[var5].b(var1, var2);
         if (var3 < var2[0]) {
            var2[0] = var3;
         }

         if (var4 > var2[1]) {
            var2[1] = var4;
         }
      }

      return true;
   }

   public boolean z() {
      if (!this.c.a()) {
         return false;
      } else {
         for(int var1 = 0; var1 < this.b.length; ++var1) {
            if (!this.b[var1].z()) {
               return false;
            }
         }

         return true;
      }
   }

   public void b(boolean var1) {
      this.c.a(var1);

      for(int var2 = 0; var2 < this.b.length; ++var2) {
         this.b[var2].b(var1);
      }

   }

   public boolean a() {
      for(int var1 = 0; var1 < this.b.length; ++var1) {
         if (!this.b[var1].a()) {
            return false;
         }
      }

      return false;
   }

   public void a(boolean var1) {
      for(int var2 = 0; var2 < this.b.length; ++var2) {
         this.b[var2].a(var1);
      }

   }

   public int i() {
      return this.b[this.g].i();
   }

   public int j() {
      return this.b[this.g].j();
   }

   public int k() {
      return this.b[this.g].k();
   }

   public boolean A() {
      return true;
   }
}
